package pl.edu.utp.kursy.database;

import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="categories")
public class CourseCategory extends BaseCourse{

    @OneToMany(fetch = FetchType.EAGER, mappedBy = "category",cascade = CascadeType.REMOVE)
    private Set<Course> courses;
    
    public CourseCategory(){}
    
    public CourseCategory(int id, String name){
        this.id = id;
        this.name = name;
    }
    
    public Set<Course> getCourses() {
        return courses;
    }

    public void setCourses(Set<Course> courses) {
        this.courses = courses;
    }
}
